﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MissionCenter
{
    /// <summary>
    /// MissionList.xaml 的交互逻辑
    /// </summary>
    public partial class MissionList : UserControl
    {
        public MissionList()
        {
            InitializeComponent();
            this.DataContext = ScriptDateList2;

        }

        /// <summary>
        /// 脚本列表数据绑定器
        /// </summary>
        public ScriptViewModel ScriptDateList2 = new ScriptViewModel();
        private void refresh_Click(object sender, RoutedEventArgs e)
        {
            //刷新脚本列表

        }

        private void test01_Click(object sender, RoutedEventArgs e)
        {
            string str = "m";//w:浏览器 m:手机 r:机器人 其它
            ScriptDateList2.ScriptList.Add(new ScriptItem
            {
                Name = "Script3",
                TypeOfScript = str == "w" ? "🌐" : str == "m" ? "📱" : str == "s" ? "💻" : "🤖"
            });
            //ListBox滚到到最后一行
            scriptlistbox.ScrollIntoView(scriptlistbox.Items[scriptlistbox.Items.Count - 1]);
        }
    }
}
